﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "StarrySkyAbilityTypes.h"
#include "StarrySkyGameplayAbility.h"
#include "StarrySkyDamageGameplayAbility.generated.h"

/**
 * 
 */
UCLASS()
class STARRYSKY_API UStarrySkyDamageGameplayAbility : public UStarrySkyGameplayAbility
{
	GENERATED_BODY()
public:
	//构建伤害参数结构体，参数带默认值可以使其成为可选参数
	UFUNCTION(BlueprintPure)
	FDamageEffectParams MakeDamageEffectParamsFromClassDefaults(
		AActor* TargetActor = nullptr,
		FVector InRadialDamageOrigin = FVector::ZeroVector,
		bool bOverrideKnockbackDirection = false,
		FVector KnockbackDirectionOverride = FVector::ZeroVector,
		bool bOverrideDeathImpulse = false,
		FVector DeathImpulseDirectionOverride = FVector::ZeroVector,
		bool bOverridePitch = false,
		float PitchOverride = 0.f) const;

protected:
	//保存抛射物能力的游戏效果
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Projectile Spell")
	TSubclassOf<UGameplayEffect> DamageEffectClass;
	
	//对应的伤害类型
	UPROPERTY(EditDefaultsOnly, Category = "Damage")
	FGameplayTag DamageType;

	//伤害数值
	UPROPERTY(EditDefaultsOnly, Category = "Damage")
	FScalableFloat Damage;
};
